//% color="#9370DB" iconWidth=50 iconHeight=40
namespace VOICE68 {

	//% block="68段语言模块 初始化RST[RST] DATA[DATA] BUSY[BUSY] " blockType="command"
	//% RST.shadow="dropdownRound" RST.options="PIN_DigitalWrite" RST.defl="PIN_DigitalWrite.default_Voice68Init_RST"
	//% DATA.shadow="dropdownRound" DATA.options="PIN_DigitalWrite" DATA.defl="PIN_DigitalWrite.default_Voice68Init_DATA"
	//% BUSY.shadow="dropdownRound" BUSY.options="PIN_DigitalWrite" BUSY.defl="PIN_DigitalWrite.default_Voice68Init_BUSY"
	export function Voice68Init(parameter: any, block: any){
		let rst = parameter.RST.code;
		let data = parameter.DATA.code;
		let busy = parameter.BUSY.code;
		Generator.addInclude("Voice68","#include <Voice68.h>");
		Generator.addObject("Voice68Object","VOICE68",`voice(${rst},${data},${busy});`);
	}



	//% block="68段语言模块 播放第[NUM]条语音" blockType="command"
	//% NUM.shadow="range" NUM.params.min=1    NUM.params.max=68    NUM.defl=68
	export function Voice68Paly(parameter: any, block: any){

		let num = parameter.NUM.code;
		Generator.addCode(`voice.play(${num});`);
	}


//
//	//% block="68段语言模块BUSY" blockType="boolean"
//	//% NUM.shadow="range" NUM.params.min=1    NUM.params.max=68    NUM.defl=68
//	export function Voice68IsBusy(parameter: any, block: any){
//
//		Generator.addCode(`voice.isBusy()`);
//	}
}
